<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <link href="css/mui.min.css" rel="stylesheet"/>
    <link href="css/icons-extra.css" rel="stylesheet"/>
    <!--<link href="mui-icons-extra.ttf" rel="stylesheet"/>-->
    <!--<script src="js/ajax.js"></script>-->
        <script src="js/mui.min.js"></script>
        <script src="js/app.js"></script>
    <script>
mui.ready(function() {
        document.getElementById("a1").addEventListener('tap', function() {
            mui.openWindow('news/home/list.html');
        });

        document.getElementById("a2").addEventListener('tap', function() {
            mui.openWindow('chat/user/list.html')            
        });

        document.getElementById("a3").addEventListener('tap', function() {
            mui.openWindow('friends/user/list.html')        
        }); 


        document.getElementById("a4").addEventListener('tap', function() {
            mui.openWindow('user/admin/index.html');
        });


        document.getElementById("a5").addEventListener('tap', function() {
             mui.openWindow('chat/user/list.html') 
        });


        document.getElementById("login").addEventListener('tap', function() {
//alert(JSON.stringify(jsontoken));
        	if(typeof jsontoken!=="object" && (jsontoken.usertoken && jsontoken.usertoken!='')){
        		jsontoken["act"]="login";

        	mui.post(home.hos+'/user/admin',jsontoken,function(data){
//      		alert(JSON.stringify(data));
        		if(data.authtime){
        			my["authtime"]=data.authtime;
        			my["usertoken"]=data.usertoken;
        			localStorage.setItem('my',JSON.stringify(my));
        		}else{
        			if(window.confirm('鉴权失败：请重新登陆;'+data)){
                   mui.openWindow('./user/home/login.html');
                 return true;
		            }else{
		                 return false;
		             }
        		}
        	},'json')
        	}else{
        		if(window.confirm('确认(立即登陆);取消(继续浏览,功能受限)')){
                   mui.openWindow('./user/home/login.html');
                 return true;
		            }else{
		                 return false;
		             }
        	}
        });
//      news();
});
</script>
<style>
	.tb{
		float: left;
		background: #00BFFF;
		list-style-type:none;
		text-align: center;
	}
	.tb1{
		/*padding: 1px;
		width: 33%;
		float: left;*/
		/*background: #00BFFF;*/
		/*list-style-type:none;
		text-align: center;*/
	}

	.td{
		padding: 5px;
		width: 100px;
		/*height: 100px;*/
		width: 30%;
		/*height:90%;*/
		margin:5px 1.6%;
		float:left;
		background: #FFF;
	}
	.tb img{
		width: 100%;
	}

.con{
		margin: 5px;
	}
	.con .pic{
		background: #FFF;
		text-align:center;
		border-radius:3px;
		float:left; 
		max-height:380px;
		overflow:hidden;
		box-shadow:2px 2px 6px #b5b5b5;
		line-height:1.2;
		margin:5px 1px;
		padding:2px;
		}
	.con span{
		padding: 2px;
	}
	.pic{
		/*max-width:150px;*/
		/*text-align:center;
		min-height:30px;*/
		/*padding:5px;*/
	}
	.pic img{
		margin:0;
		width:100%;
		min-height:10px;
		/*max-width:100px;*/
	}
	.pic:active {background: #F0F0F0}
	/*.pic:link {color: #FF0000}*/
/*.pic:visited {color: #00FF00}*/
/*.pic:hover {color: #FF00FF}*/
/*.pic:active {color: #0000FF}*/
</style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
	<a id="a5" class="mui-icon mui-icon-chatboxes mui-pull-right" ><span style="font-size: 0.7em;padding:3px; color:orangered;border-radius:5px;"id="unread">0</span></a>
	<a id="login" class="mui-icon mui-icon-chatboxes mui-pull-left" ><span style="font-size: 0.7em;padding:3px; color:orangered;border-radius:5px;">登陆</span></a>
        <h1 class="mui-title" onclick="history.go(0)">第一电影人</h1>
 </header>
 
  <div class="mui-content">

      	<!--轮播-->
  	    <div class="mui-slider">
			  <div class="mui-slider-group">
			    <!--第一个内容区容器-->
			    <div class="mui-slider-item">
			    	<img src="weixin/image/2.jpg" alt="" />
			      <!-- 具体内容 -->
			    </div>
			    
			    <!--第二个内容区-->
			    <div class="mui-slider-item">
			    	<img src="weixin/image/2.jpg" alt="" />
			      <!-- 具体内容 -->
			    </div>
			  </div>
		</div>
  	 <div class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
    <div class="mui-scroll" style="background: #FFB400;">
        <a class="mui-control-item mui-active">
            推荐
        </a>
        <a class="mui-control-item">
            热点
        </a>
        <a class="mui-control-item">
            北京
        </a>
        <a class="mui-control-item">
            社会
        </a>
        <a class="mui-control-item">
            娱乐
        </a>
        <a class="mui-control-item">
            科技
        </a>
    </div>
  </div>
  	<div class="slide-box" id="cons1" style="float:left;width: 33%;"></div>
  	<div class="slide-box" id="cons2" style="float:left;width: 33%;"></div>
  	<div class="slide-box" id="cons3" style="float:left;width: 33%;"></div>

	</div>
     
   <nav class="mui-bar mui-bar-tab" id="nav">
        <a class="mui-tab-item mui-active" id="a1">
            <span class="mui-icon mui-icon-home"></span>
            <span class="mui-tab-label">首页</span>
        </a>
        <a class="mui-tab-item" id="a2">
            <span class="mui-icon mui-icon-chatboxes"></span>
            <span class="mui-tab-labe2">消息</span>
        </a>
        <a class="mui-tab-item" id="a3">
            <span class="mui-icon-extra mui-icon-extra-peoples"></span>
            <span class="mui-tab-labe3">好友</span>
        </a>
        <a class="mui-tab-item" id="a4">
            <span class="mui-icon mui-icon-person"></span>
            <span class="mui-tab-labe4">我的</span>
        </a>
    </nav>

</body>
<script type="text/javascript">
	var cons1=document.getElementById('cons1');
	var cons2=document.getElementById('cons2');
	var cons3=document.getElementById('cons3');
//	'+(cons1).height()+'
//	alert(cons2.offsetHeight);
	for(var i=0;i<10;i++){
//		if(cons2.offsetHeight && cons2.offsetHeight>cons1.offsetHeight){
		html='<div class="con" style=""><div class="pic"  style="height:auto;padding:5px;max-width:auto;min-height:30px;padding:2px; "><p style="position:absolute;text-align:center;border-radius:9px;color:#fff;line-height:1em;background:red;padding:3px">挺好</p><img  src="images/qq.png" onclick="" /><h5><span id="height'+i+'">'+cons1.offsetHeight+'</span>饰:李逵'+cons2.offsetHeight+'</h5> <p>嗯嗯</p></div></div>';
//		document.getElementById('height'+i).innerHTML=document.getElementById("cons2").offsetHeight||document.getElementById("cons2").clientHeight;	
		if(cons3.offsetHeight>=cons1.offsetHeight && cons2.offsetHeight>=cons1.offsetHeight){

			cons1.innerHTML+=html;
//			cons1.appendChild(html);
		}else if(cons1.offsetHeight>cons2.offsetHeight && cons3.offsetHeight>=cons2.offsetHeight){
			cons2.innerHTML+=html;
//			cons2.appendChild(html);
		}else{
			cons3.innerHTML+=html;
		}
		
	}

//未读消息数量
function news(){
			apptoken['act']= 'unread';
mui.post(home.hos+'/Chat/user',apptoken,function(data){
//	alert(data);
	if(data=='204'){
	 		plus.ui.toast("没有新消息",data);
	 }else if(isJSON(data)){
//	 		alert(data);
	var result=JSON.parse(data);
	if(result.sum){
	document.getElementById('unread').innerHTML=result.sum;	
	}
	}else{
	 		plus.ui.toast("操作失败",data);
	 	}
		//服务器返回响应，根据响应结果，分析是否登录成功；
	},'text');
}
</script>
</html>